#!/bin/bash
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2016, Numenta, Inc.  Unless you have purchased from
# Numenta, Inc. a separate commercial license for this software code, the
# following terms and conditions apply:
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero Public License version 3 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU Affero Public License for more details.
#
# You should have received a copy of the GNU Affero Public License
# along with this program.  If not, see http://www.gnu.org/licenses.
#
# http://numenta.org/licenses/
# ----------------------------------------------------------------------

# This script sets up the common environment for bulding a manylinux x86_64
# wide-unicode nupic.bindings wheel. It's intended to be sourced by the
# build-type-specific manylinux build scripts.

set -o errexit
set -o xtrace

# Python prefix for this manylinux build (the common wide-unicode version)
_PYTHON_PREFIX="/opt/python/cp27-cp27mu"

# Add the python 2.7 binaries from manylinux image to PATH, overriding system
# Python
# NOTE unlike the community manylinux docker image that builds statically-linked
# python, Numenta's custom manylinux image builds python with libpython.so
# library, because some nupic.core C++ tests depend on having libpython.so.
export PATH="${_PYTHON_PREFIX}/bin:${PATH}"
export LD_LIBRARY_PATH="${_PYTHON_PREFIX}/lib:${LD_LIBRARY_PATH}"

# Help cmake find the desired python, its libs, and headers
export CMAKE_PREFIX_PATH=${_PYTHON_PREFIX}
